package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerAgentUserInfo implements IQLResponse
{
    /// <summary>
    /// 玩家Id
    /// </summary>
    public long UserId;

    /// <summary>
    /// 昵称
    /// </summary>
    public String Nickname;

    /// <summary>
    /// 当前总贡献点数，显示时要除以100
    /// </summary>
    public long Assets;

    /// <summary>
    /// 旗下代理总贡献，显示时要除以100
    /// </summary>
    public long TotalAssets;

    /// <summary>
    /// 旗下下一级代理数量
    /// </summary>
    public long SubUserCount;

    /// <summary>
    /// 总自动兑换弹头数量
    /// </summary>
    public long TotalWarheadCount;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("user_id"))
            UserId = t.getLong("user_id");
        if (t.has("nickname"))
            Nickname = t.getString("nickname");
        if (t.has("assets"))
            Assets = t.getLong("assets");
        if (t.has("total_assets"))
            TotalAssets = t.getLong("total_assets");
        if (t.has("sub_user_count"))
            SubUserCount = t.getLong("sub_user_count");
        if (t.has("total_warhead_count"))
            TotalWarheadCount = t.getLong("total_warhead_count");
    }
}
